<!DOCTYPE html>
<html lang=zh>
<head>
    <meta charset="utf-8">
    
    <title>原码、反码、补码 | 睡不醒的黑客</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="原码、反码、补码原码1231   &#x3D;&gt; 000000011   &#x3D;&gt; 00000010-1  &#x3D;&gt; 10000001  当一个正数与一个负数的原码做加法时： 1234567891011121314151 + (-1)  00000001+ 10000001-----------  10000010  10000010 &#x3D;&gt; -2 &amp;#">
<meta property="og:type" content="article">
<meta property="og:title" content="原码、反码、补码">
<meta property="og:url" content="https://hq229075284.github.io/blog/2021/04/%E5%8E%9F%E7%A0%81%E3%80%81%E5%8F%8D%E7%A0%81%E3%80%81%E8%A1%A5%E7%A0%81/index.html">
<meta property="og:site_name" content="睡不醒的黑客">
<meta property="og:description" content="原码、反码、补码原码1231   &#x3D;&gt; 000000011   &#x3D;&gt; 00000010-1  &#x3D;&gt; 10000001  当一个正数与一个负数的原码做加法时： 1234567891011121314151 + (-1)  00000001+ 10000001-----------  10000010  10000010 &#x3D;&gt; -2 &amp;#">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://i.postimg.cc/43dbyMfM/encode.jpg">
<meta property="article:published_time" content="2021-04-23T17:35:26.000Z">
<meta property="article:modified_time" content="2022-08-31T01:14:15.551Z">
<meta property="article:author" content="HanQ">
<meta property="article:tag" content="计算器原理">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://i.postimg.cc/43dbyMfM/encode.jpg">
    

    

    

    
<link rel="stylesheet" href="/blog/libs/font-awesome/css/font-awesome.min.css">

    
<link rel="stylesheet" href="/blog/libs/open-sans/styles.css">

    
<link rel="stylesheet" href="/blog/libs/source-code-pro/styles.css">


    
<link rel="stylesheet" href="/blog/css/style.css">


    
<script src="/blog/libs/jquery/2.1.3/jquery.min.js"></script>

    
    
        
<link rel="stylesheet" href="/blog/libs/lightgallery/css/lightgallery.min.css">

    
    
        
<link rel="stylesheet" href="/blog/libs/justified-gallery/justifiedGallery.min.css">

    
    
    
    
        <script>
var _hmt = _hmt || [];
(function() {
    var hm = document.createElement("script");
    hm.src = "//hm.baidu.com/hm.js?c5e2de02c4aac83227b728f6dc16f902";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();
</script>

    


<meta name="generator" content="Hexo 4.2.1"></head>

<body>
    <div id="container">
        <header id="header">
    <div id="header-main" class="header-inner">
        <div class="outer">
            <a href="/blog/" id="logo">
                <i class="logo"></i>
                <span class="site-title">睡不醒的黑客</span>
            </a>
            <nav id="main-nav">
                
                    <a class="main-nav-link" href="/blog/.">首页</a>
                
                    <a class="main-nav-link" href="/blog/archives">归档</a>
                
                    <a class="main-nav-link" href="/blog/github">GitHub仓库</a>
                
            </nav>
            
                
                <nav id="sub-nav">
                    <div class="profile" id="profile-nav">
                        <a id="profile-anchor" href="javascript:;">
                            <img class="avatar" src="/blog/images/IMG_0049.JPG" />
                            <i class="fa fa-caret-down"></i>
                        </a>
                    </div>
                </nav>
            
            <div id="search-form-wrap">

    <form class="search-form">
        <input type="text" class="ins-search-input search-form-input" placeholder="搜索" />
        <button type="submit" class="search-form-submit"></button>
    </form>
    <div class="ins-search">
    <div class="ins-search-mask"></div>
    <div class="ins-search-container">
        <div class="ins-input-wrapper">
            <input type="text" class="ins-search-input" placeholder="想要查找什么..." />
            <span class="ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
        </div>
        <div class="ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
(function (window) {
    var INSIGHT_CONFIG = {
        TRANSLATION: {
            POSTS: '文章',
            PAGES: '页面',
            CATEGORIES: '分类',
            TAGS: '标签',
            UNTITLED: '(未命名)',
        },
        ROOT_URL: '/blog/',
        CONTENT_URL: '/blog/content.json',
    };
    window.INSIGHT_CONFIG = INSIGHT_CONFIG;
})(window);
</script>

<script src="/blog/js/insight.js"></script>


</div>
        </div>
    </div>
    <div id="main-nav-mobile" class="header-sub header-inner">
        <table class="menu outer">
            <tr>
                
                    <td><a class="main-nav-link" href="/blog/.">首页</a></td>
                
                    <td><a class="main-nav-link" href="/blog/archives">归档</a></td>
                
                    <td><a class="main-nav-link" href="/blog/github">GitHub仓库</a></td>
                
                <td>
                    
    <div class="search-form">
        <input type="text" class="ins-search-input search-form-input" placeholder="搜索" />
    </div>

                </td>
            </tr>
        </table>
    </div>
</header>

        <div class="outer">
            
                

<aside id="profile">
    <div class="inner profile-inner">
        <div class="base-info profile-block">
            <img id="avatar" src="/blog/images/IMG_0049.JPG" />
            <h2 id="name">HanQ</h2>
            <h3 id="title">Web Developer &amp; Node Developer</h3>
            <span id="location"><i class="fa fa-map-marker"></i>HangZhou, China</span>
            <a id="follow" target="_blank" href="https://github.com/hq229075284">关注我</a>
        </div>
        <div class="article-info profile-block">
            <div class="article-info-block">
                27
                <span>文章</span>
            </div>
            <div class="article-info-block">
                8
                <span>标签</span>
            </div>
        </div>
        
        <div class="profile-block social-links">
            <table>
                <tr>
                    
                    
                    <td>
                        <a href="https://github.com/hq229075284" target="_blank" title="github" >
                            <i class="fa fa-github"></i>
                        </a>
                    </td>
                    
                </tr>
            </table>
        </div>
        
    </div>
</aside>

            
            <section id="main" ><article id="post-原码、反码、补码" class="article article-type-post" itemscope itemprop="blogPost">
    <div class="article-inner">
        
            
	
		<img src="https://i.postimg.cc/43dbyMfM/encode.jpg" class="article-banner" />
	



        
        
            <header class="article-header">
                
    
        <h1 class="article-title" itemprop="name">
            原码、反码、补码
        </h1>
    

                
                    <div class="article-meta">
                        
    <div class="article-date">
        <i class="fa fa-calendar"></i>
        <a href="/blog/2021/04/%E5%8E%9F%E7%A0%81%E3%80%81%E5%8F%8D%E7%A0%81%E3%80%81%E8%A1%A5%E7%A0%81/">
            <time datetime="2021-04-23T17:35:26.000Z" itemprop="datePublished">2021-04-23</time>
        </a>
    </div>


                        
                        
    <div class="article-tag">
        <i class="fa fa-tag"></i>
        <a class="tag-link" href="/blog/tags/%E8%AE%A1%E7%AE%97%E5%99%A8%E5%8E%9F%E7%90%86/" rel="tag">计算器原理</a>
    </div>

                    </div>
                
            </header>
        
        
        <div class="article-entry" itemprop="articleBody">
        
            
            <h1 id="原码、反码、补码"><a href="#原码、反码、补码" class="headerlink" title="原码、反码、补码"></a>原码、反码、补码</h1><h2 id="原码"><a href="#原码" class="headerlink" title="原码"></a>原码</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">1   &#x3D;&gt; 00000001</span><br><span class="line">1   &#x3D;&gt; 00000010</span><br><span class="line">-1  &#x3D;&gt; 10000001</span><br></pre></td></tr></table></figure>

<p>当一个正数与一个负数的原码做加法时：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">1 + (-1)</span><br><span class="line">  00000001</span><br><span class="line">+ 10000001</span><br><span class="line">-----------</span><br><span class="line">  10000010</span><br><span class="line">  </span><br><span class="line">10000010 &#x3D;&gt; -2 &#x2F;&#x2F; 按原码的方式转化为十进制</span><br><span class="line"></span><br><span class="line">2 + (-1)</span><br><span class="line">  00000010</span><br><span class="line">+ 10000001</span><br><span class="line">-----------</span><br><span class="line">  10000011</span><br><span class="line">  </span><br><span class="line">10000011 &#x3D;&gt; -3 &#x2F;&#x2F; 按原码的方式转化为十进制</span><br></pre></td></tr></table></figure>

<p>异号数字的原码相加，原码的符号位一定为1，和实际情况不服，比如： 2 + -1。</p>
<a id="more"></a>

<h2 id="反码"><a href="#反码" class="headerlink" title="反码"></a>反码</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&#x2F;&#x2F; 正数 1</span><br><span class="line">00000001 &#x2F;&#x2F;原码</span><br><span class="line">00000001 &#x2F;&#x2F;反码</span><br><span class="line">&#x2F;&#x2F; 负数 -1</span><br><span class="line">10000001 &#x2F;&#x2F;原码</span><br><span class="line">11111110 &#x2F;&#x2F;反码</span><br></pre></td></tr></table></figure>

<p>正数的反码就是原码本身，负数的反码就是原码除符号位外，按位取反。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">1 + (-1)</span><br><span class="line">  00000001 &#x2F;&#x2F; 1的反码</span><br><span class="line">+ 11111110 &#x2F;&#x2F; -1的反码</span><br><span class="line">-----------</span><br><span class="line">  11111111</span><br><span class="line">  </span><br><span class="line">11111111 &#x3D;反码转原码&#x3D;&gt; 10000000 &#x3D;转十进制&#x3D;&gt; -0 &#x2F;&#x2F; 按原码的方式转化为十进制</span><br></pre></td></tr></table></figure>

<p>反码相加，解决了相反数之间相加的问题，但</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">2 + (-1)</span><br><span class="line">  00000010 &#x2F;&#x2F; 2的反码</span><br><span class="line">+ 11111110 &#x2F;&#x2F; -1的反码</span><br><span class="line">-----------</span><br><span class="line">  00000000</span><br><span class="line">  </span><br><span class="line">00000000 &#x3D;反码转原码&#x3D;&gt; 00000000 &#x3D;转十进制&#x3D;&gt; +0 &#x2F;&#x2F; 按原码的方式转化为十进制</span><br></pre></td></tr></table></figure>

<p>计算结果仍有问题</p>
<h2 id="补码（仍需完善）"><a href="#补码（仍需完善）" class="headerlink" title="补码（仍需完善）"></a>补码（仍需完善）</h2><p>正数的补码等于原码，负数的补码等于原码自低位向高位，第一个出现的‘1’及其右边的‘0’保持不变，左边的各位按位取反，符号位不变。</p>
<p>比如在4位系统下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">2 + (-1)</span><br><span class="line"></span><br><span class="line">  0010</span><br><span class="line">+ 1001</span><br></pre></td></tr></table></figure>

<p>将原码计算转换为补码计算：</p>
<p><code>2 + (-1)</code>=<code>2 + (2^4-1)</code></p>
<table>
<thead>
<tr>
<th>二进制编码</th>
<th>十进制</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td>0000</td>
<td>0</td>
<td></td>
</tr>
<tr>
<td>0001</td>
<td>1</td>
<td>&lt;&lt; 结果位置</td>
</tr>
<tr>
<td>0010</td>
<td>2</td>
<td>&lt;&lt; 被减数位置</td>
</tr>
<tr>
<td>0011</td>
<td>3</td>
<td></td>
</tr>
<tr>
<td>0100</td>
<td>4</td>
<td></td>
</tr>
<tr>
<td>0101</td>
<td>5</td>
<td></td>
</tr>
<tr>
<td>0110</td>
<td>6</td>
<td></td>
</tr>
<tr>
<td>0111</td>
<td>7</td>
<td></td>
</tr>
<tr>
<td>1000</td>
<td>-8</td>
<td></td>
</tr>
<tr>
<td>1001</td>
<td>-1</td>
<td></td>
</tr>
<tr>
<td>1010</td>
<td>-2</td>
<td></td>
</tr>
<tr>
<td>1011</td>
<td>-3</td>
<td></td>
</tr>
<tr>
<td>1100</td>
<td>-4</td>
<td></td>
</tr>
<tr>
<td>1101</td>
<td>-5</td>
<td></td>
</tr>
<tr>
<td>1110</td>
<td>-6</td>
<td></td>
</tr>
<tr>
<td>1111</td>
<td>-7</td>
<td></td>
</tr>
</tbody></table>
<p> 从上面的表格可以看出，<code>被减数-减数</code>可以看成<code>被减数+减数的同余数</code>，因为在计算机中，最大值溢出后会从0开始重新计数，所以做减法时，可以看成从被减数一直加，加到溢出后，从0开始再加，直到加到结果值位置。累加的总值就是补码的编码（可以理解为补码没有符合位，只是个偏移量），即通过<code>补码=2^n-减数</code>算出补码在十进制的数值，再将补码转成对应的二进制编码。</p>
<p>当<code>被减数+补码</code>的值为正数时，因为都是从0累加，所以计算的结果和预期结果值一致，不需要转换。</p>
<p>而当<code>被减数+补码</code>的值为负数时，比如：<code>2 - 4 = -2</code> =&gt; <code>2 + (16 - 4) = -2</code>=&gt; <code>2 + 12 = -2</code></p>
<table>
<thead>
<tr>
<th>二进制编码</th>
<th>十进制</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td>0000</td>
<td>0</td>
<td></td>
</tr>
<tr>
<td>0001</td>
<td>1</td>
<td></td>
</tr>
<tr>
<td>0010</td>
<td>2</td>
<td>&lt;&lt; 被减数位置</td>
</tr>
<tr>
<td>0011</td>
<td>3</td>
<td></td>
</tr>
<tr>
<td>0100</td>
<td>4</td>
<td></td>
</tr>
<tr>
<td>0101</td>
<td>5</td>
<td></td>
</tr>
<tr>
<td>0110</td>
<td>6</td>
<td></td>
</tr>
<tr>
<td>0111</td>
<td>7</td>
<td></td>
</tr>
<tr>
<td>1000</td>
<td>-8</td>
<td></td>
</tr>
<tr>
<td>1001</td>
<td>-1</td>
<td></td>
</tr>
<tr>
<td>1010</td>
<td>-2</td>
<td>&lt;&lt; 结果位置，记作R2</td>
</tr>
<tr>
<td>1011</td>
<td>-3</td>
<td></td>
</tr>
<tr>
<td>1100</td>
<td>-4</td>
<td></td>
</tr>
<tr>
<td>1101</td>
<td>-5</td>
<td>&lt;&lt; R2的反码，记作R3</td>
</tr>
<tr>
<td>1110</td>
<td>-6</td>
<td>&lt;&lt; 被减数+补码 位置，记作R1</td>
</tr>
<tr>
<td>1111</td>
<td>-7</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>10000（仅用作参考，无符号位，无位数限制）</td>
<td>2^4</td>
<td>模</td>
</tr>
</tbody></table>
<p>2-3=-1 但实际计算出来的编码转化为十进制为-7</p>
<p>2-4=-2 但实际计算出来的编码转化为十进制为-6</p>
<p>可以看出，将预期值的绝对值作为偏移量，实际计算出的二进制值（1110）加上偏移量（0010），刚好等于模（10000）</p>
<p>因为<code>补码+负数的绝对值等于模</code>，且<code>R1+|R2|=模</code>,所以<code>R1</code>是<code>R2</code>的补码，所以两数相减为负数时实际计算出来的是结果的补码，要得到原码，需要将补码转换为原码，但1000(补)没有原码，直接就表示原值<code>-2^n</code>。</p>
<p>-2可以看成1010=1000+0010（正向偏移）,-2的反码可以看成1101=1111-0010（反向偏移）</p>
<p><strong>补码等于反码+1：</strong><code>R3+|R2|+1=模=R1+|R2| =&gt; R3+1=R1</code></p>
<p>类似<code>-2-4</code>这类的，可以看作是<code>(0-2)-4</code>，先算出-2位置的值，再算出-2-4位置的值。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">2 + (2^4-1) &#x2F;&#x2F; 在8位系统下，2^4-1 就是 -1 的补码，负数的绝对值+补码&#x3D;2^n(n为位数)</span><br><span class="line">  0010</span><br><span class="line">+ 1111  </span><br><span class="line">----------</span><br><span class="line">  0001</span><br><span class="line"></span><br><span class="line">2^4-1</span><br><span class="line">1111 &#x2F;&#x2F; -1的补码</span><br><span class="line"></span><br><span class="line">-1</span><br><span class="line">1001 &#x2F;&#x2F; -1的原码</span><br><span class="line">1110 &#x2F;&#x2F; -1的反码</span><br></pre></td></tr></table></figure>

        
        </div>
        <footer class="article-footer">
            <div class="share-container">



</div>

    <a data-url="https://hq229075284.github.io/blog/2021/04/%E5%8E%9F%E7%A0%81%E3%80%81%E5%8F%8D%E7%A0%81%E3%80%81%E8%A1%A5%E7%A0%81/" data-id="cl7gxergy000uo4tldn3m30sq" class="article-share-link"><i class="fa fa-share"></i>分享到</a>
<script>
    (function ($) {
        // Prevent duplicate binding
        if (typeof(__SHARE_BUTTON_BINDED__) === 'undefined' || !__SHARE_BUTTON_BINDED__) {
            __SHARE_BUTTON_BINDED__ = true;
        } else {
            return;
        }
        $('body').on('click', function() {
            $('.article-share-box.on').removeClass('on');
        }).on('click', '.article-share-link', function(e) {
            e.stopPropagation();

            var $this = $(this),
                url = $this.attr('data-url'),
                encodedUrl = encodeURIComponent(url),
                id = 'article-share-box-' + $this.attr('data-id'),
                offset = $this.offset(),
                box;

            if ($('#' + id).length) {
                box = $('#' + id);

                if (box.hasClass('on')){
                    box.removeClass('on');
                    return;
                }
            } else {
                var html = [
                    '<div id="' + id + '" class="article-share-box">',
                        '<input class="article-share-input" value="' + url + '">',
                        '<div class="article-share-links">',
                            '<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="fa fa-twitter article-share-twitter" target="_blank" title="Twitter"></a>',
                            '<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="fa fa-facebook article-share-facebook" target="_blank" title="Facebook"></a>',
                            '<a href="http://pinterest.com/pin/create/button/?url=' + encodedUrl + '" class="fa fa-pinterest article-share-pinterest" target="_blank" title="Pinterest"></a>',
                            '<a href="https://plus.google.com/share?url=' + encodedUrl + '" class="fa fa-google article-share-google" target="_blank" title="Google+"></a>',
                        '</div>',
                    '</div>'
                ].join('');

              box = $(html);

              $('body').append(box);
            }

            $('.article-share-box.on').hide();

            box.css({
                top: offset.top + 25,
                left: offset.left
            }).addClass('on');

        }).on('click', '.article-share-box', function (e) {
            e.stopPropagation();
        }).on('click', '.article-share-box-input', function () {
            $(this).select();
        }).on('click', '.article-share-box-link', function (e) {
            e.preventDefault();
            e.stopPropagation();

            window.open(this.href, 'article-share-box-window-' + Date.now(), 'width=500,height=450');
        });
    })(jQuery);
</script>

            
    

        </footer>
    </div>
    
        
<nav id="article-nav">
    
        <a href="/blog/2021/05/glob-match/" id="article-nav-newer" class="article-nav-link-wrap">
            <strong class="article-nav-caption">上一篇</strong>
            <div class="article-nav-title">
                
                    glob_match
                
            </div>
        </a>
    
    
        <a href="/blog/2020/11/es6-es11/" id="article-nav-older" class="article-nav-link-wrap">
            <strong class="article-nav-caption">下一篇</strong>
            <div class="article-nav-title">es6-es11</div>
        </a>
    
</nav>


    
</article>


    
    

</section>
            
                
<aside id="sidebar">
   
        
    <div class="widget-wrap">
        <h3 class="widget-title">最新文章</h3>
        <div class="widget">
            <ul id="recent-post" class="">
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/blog/2022/08/notes/" class="thumbnail">
    
    
        <span class="thumbnail-image thumbnail-none"></span>
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"></p>
                            <p class="item-title"><a href="/blog/2022/08/notes/" class="title">notes</a></p>
                            <p class="item-date"><time datetime="2022-08-31T01:14:15.551Z" itemprop="datePublished">2022-08-31</time></p>
                        </div>
                    </li>
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/blog/2022/04/css-grid/" class="thumbnail">
    
    
        <span style="background-image:url(https://s1.ax1x.com/2022/04/15/L8yHat.jpg)" alt="Grid" class="thumbnail-image"></span>
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"><a class="article-category-link" href="/blog/categories/css/">css</a></p>
                            <p class="item-title"><a href="/blog/2022/04/css-grid/" class="title">Grid</a></p>
                            <p class="item-date"><time datetime="2022-04-15T16:11:20.000Z" itemprop="datePublished">2022-04-15</time></p>
                        </div>
                    </li>
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/blog/2022/04/css%E4%BC%98%E5%85%88%E7%BA%A7/" class="thumbnail">
    
    
        <span class="thumbnail-image thumbnail-none"></span>
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"><a class="article-category-link" href="/blog/categories/css/">css</a></p>
                            <p class="item-title"><a href="/blog/2022/04/css%E4%BC%98%E5%85%88%E7%BA%A7/" class="title">css选择器和style属性的权值计算和比较</a></p>
                            <p class="item-date"><time datetime="2022-04-15T16:11:10.000Z" itemprop="datePublished">2022-04-15</time></p>
                        </div>
                    </li>
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/blog/2022/01/border-image-slice/" class="thumbnail">
    
    
        <span style="background-image:url(https://www.wangzhanchengxu.com/uploadfile/2017/0325/20170325114208581.gif)" alt="border-image-slice" class="thumbnail-image"></span>
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"><a class="article-category-link" href="/blog/categories/css/">css</a></p>
                            <p class="item-title"><a href="/blog/2022/01/border-image-slice/" class="title">border-image-slice</a></p>
                            <p class="item-date"><time datetime="2022-01-13T16:55:16.000Z" itemprop="datePublished">2022-01-13</time></p>
                        </div>
                    </li>
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/blog/2021/12/css%E4%B8%BB%E9%A2%98%E5%8C%96/" class="thumbnail">
    
    
        <span class="thumbnail-image thumbnail-none"></span>
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"></p>
                            <p class="item-title"><a href="/blog/2021/12/css%E4%B8%BB%E9%A2%98%E5%8C%96/" class="title">css主题化</a></p>
                            <p class="item-date"><time datetime="2021-12-01T16:10:24.000Z" itemprop="datePublished">2021-12-01</time></p>
                        </div>
                    </li>
                
            </ul>
        </div>
    </div>

    
        
    <div class="widget-wrap">
        <h3 class="widget-title">分类</h3>
        <div class="widget">
            <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/blog/categories/css/">css</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/shell/">shell</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/typescript/">typescript</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/web-api/">web-api</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/web%E5%AE%89%E5%85%A8/">web安全</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/%E5%85%BC%E5%AE%B9%E6%80%A7/">兼容性</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/%E8%BF%90%E7%BB%B4/">运维</a><span class="category-list-count">2</span></li></ul>
        </div>
    </div>

    
        
    <div class="widget-wrap">
        <h3 class="widget-title">归档</h3>
        <div class="widget">
            <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2022/08/">八月 2022</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2022/04/">四月 2022</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2022/01/">一月 2022</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2021/12/">十二月 2021</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2021/05/">五月 2021</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2021/04/">四月 2021</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2020/11/">十一月 2020</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2020/06/">六月 2020</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2020/05/">五月 2020</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2020/01/">一月 2020</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2019/06/">六月 2019</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2019/02/">二月 2019</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2018/11/">十一月 2018</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2018/10/">十月 2018</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2018/08/">八月 2018</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2018/05/">五月 2018</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2018/03/">三月 2018</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2017/08/">八月 2017</a><span class="archive-list-count">1</span></li></ul>
        </div>
    </div>

    
        
    <div class="widget-wrap">
        <h3 class="widget-title">标签</h3>
        <div class="widget">
            <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/css/" rel="tag">css</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/docker/" rel="tag">docker</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/es/" rel="tag">es</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/es6/" rel="tag">es6</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/glob/" rel="tag">glob</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/web-api/" rel="tag">web-api</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/%E5%85%BC%E5%AE%B9%E6%80%A7/" rel="tag">兼容性</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/%E8%AE%A1%E7%AE%97%E5%99%A8%E5%8E%9F%E7%90%86/" rel="tag">计算器原理</a><span class="tag-list-count">1</span></li></ul>
        </div>
    </div>

    
        
    <div class="widget-wrap">
        <h3 class="widget-title">标签云</h3>
        <div class="widget tagcloud">
            <a href="/blog/tags/css/" style="font-size: 20px;">css</a> <a href="/blog/tags/docker/" style="font-size: 15px;">docker</a> <a href="/blog/tags/es/" style="font-size: 10px;">es</a> <a href="/blog/tags/es6/" style="font-size: 10px;">es6</a> <a href="/blog/tags/glob/" style="font-size: 10px;">glob</a> <a href="/blog/tags/web-api/" style="font-size: 10px;">web-api</a> <a href="/blog/tags/%E5%85%BC%E5%AE%B9%E6%80%A7/" style="font-size: 10px;">兼容性</a> <a href="/blog/tags/%E8%AE%A1%E7%AE%97%E5%99%A8%E5%8E%9F%E7%90%86/" style="font-size: 10px;">计算器原理</a>
        </div>
    </div>

    
        
    <div class="widget-wrap widget-list">
        <h3 class="widget-title">链接</h3>
        <div class="widget">
            <ul>
                
                    <li>
                        <a href="http://hexo.io" target="_blank" rel="noopener">Hexo</a>
                    </li>
                
            </ul>
        </div>
    </div>


    
    <div id="toTop" class="fa fa-angle-up"></div>
</aside>

            
        </div>
        <footer id="footer">
    <div class="outer">
        <div id="footer-info" class="inner">
            &copy; 2022 HanQ<br>
            Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>. Theme by <a href="http://github.com/ppoffice" target="_blank" rel="noopener">PPOffice</a>
        </div>
    </div>
</footer>
        


    
        
<script src="/blog/libs/lightgallery/js/lightgallery.min.js"></script>

        
<script src="/blog/libs/lightgallery/js/lg-thumbnail.min.js"></script>

        
<script src="/blog/libs/lightgallery/js/lg-pager.min.js"></script>

        
<script src="/blog/libs/lightgallery/js/lg-autoplay.min.js"></script>

        
<script src="/blog/libs/lightgallery/js/lg-fullscreen.min.js"></script>

        
<script src="/blog/libs/lightgallery/js/lg-zoom.min.js"></script>

        
<script src="/blog/libs/lightgallery/js/lg-hash.min.js"></script>

        
<script src="/blog/libs/lightgallery/js/lg-share.min.js"></script>

        
<script src="/blog/libs/lightgallery/js/lg-video.min.js"></script>

    
    
        
<script src="/blog/libs/justified-gallery/jquery.justifiedGallery.min.js"></script>

    
    



<!-- Custom Scripts -->

<script src="/blog/js/main.js"></script>


    </div>
</body>
</html>